/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package healthcare.coursework.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Administrator
 */
@Embeddable
public class TestSamplesPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "USERNAME", nullable = false, length = 20)
    private String username;
    @Basic(optional = false)
    @Column(name = "FACILITY_ID", nullable = false)
    private long facilityId;
    @Basic(optional = false)
    @Column(name = "PATIENT_ID", nullable = false)
    private long patientId;

    public TestSamplesPK() {
    }

    public TestSamplesPK(String username, Long facilityId, long patientId) {
        this.username = username;
        this.facilityId = facilityId;
        this.patientId = patientId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public long getFacilityId() {
        return facilityId;
    }

    public void setFacilityId(long facilityId) {
        this.facilityId = facilityId;
    }
    

    public long getPatientId() {
        return patientId;
    }

    public void setPatientId(long patientId) {
        this.patientId = patientId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (username != null ? username.hashCode() : 0);
        hash += (int) facilityId;
        hash += (int) patientId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TestSamplesPK)) {
            return false;
        }
        TestSamplesPK other = (TestSamplesPK) object;
        if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) {
            return false;
        }
        if (this.facilityId != other.facilityId) {
            return false;
        }
        if (this.patientId != other.patientId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "healthcare.coursework.model.TestSamplesPK[username=" + username + ", facilityId=" + facilityId + ", patientId=" + patientId + "]";
    }

}
